package com.suven.framework.generator.temp;


/**
 * @Title: saasCodeEnum.java
 * @author suven
 * @date   2019-10-18 12:35:25
 * @version V1.0
 *  <pre>
 * 修改记录
 *    修改后版本:     修改人：  修改日期:     修改内容:
 * </pre>
 * Description:  java saas类型的模块 实现类
 *     //http service项目 adapter
 *     HTTP_FACADE(1,1,"http-xxx-service","adapter","业务接口实现"),
 *     //后台管理系统
 *     HTTP_CONTROLLER_WEB(2,3,"http-admin-service","admin","后台管理系统"),
 *
 *     //app service + domain //提供内部mvc使用
 *     APP_SERVICE(3,4,"app-xxx-service","app","app-service-domain //提供内部mvc使用"),
 *
 *     //后台sys api
 *     HTTP_VO_PARAMETER(4,2,"api-xxx-vo","parameter","AddRequestVo和ResponseVo"),
 *     //微服务,内部调用 api service项目 app + domain 提供外部spring cloud使用,通过代码实现对外服务
 *     API_SERVICE(5,5,"api-xxx-service","api","Api.java"),
 *
 *     //rpc infrastructure
 *     RPC_INFRASTRUCTURE(6,2,"rpc-xxx-service","infrastructure","infrastructure领域驱动项目"),
 *     //domain 基础公共对象配置
 *     RPC_DTO_DOMAIN(7,2,"domain-xxx-service","domain","RequestDto 请求参数,数据条件查询枚举"),
 */


public enum SaasCodeEnum implements CreateCodeEnum{

    //http service项目 adapter
    HTTP_CONTROLLER(1,"saas","/saas/saas_controller.java.vm","/controller/","Controller.java"),
    //后台管理系统
    HTTP_CONTROLLER_WEB(1,"saas","/saas/saas_controller_web.java.vm","/controller/","WebController.java"),

    //app service + domain //提供内部mvc使用

    //HTTP App service + domain //提供内部mvc使用 组合api,client,infrastructure 业务实现
    HTTP_FACADE(3,"saas","/saas/saas_base_facade.java.vm","/facade/","Facade.java"),
    APP_SERVICE(3,"saas","/saas/saas_service.java.vm","/service/","Service.java"),
    APP_SERVICE_IMPL(3,"saas","/saas/saas_service_impl.java.vm","/service/impl/","ServiceImpl.java"),


    //后台sys api http 相关请求接口入参和返回参数对象
    HTTP_VO_REQUEST_ADD(4,"saas","/saas/saas_base_request_add_vo.java.vm","/vo/request/","AddRequestVo.java",1),
    HTTP_VO_REQUEST_QUERY(4,"saas","/saas/saas_base_request_query_vo.java.vm","/vo/request/","QueryRequestVo.java",1),
    HTTP_VO_RESPONSE_SHOW(4,"saas","/saas/saas_base_response_show_vo.java.vm","/vo/response/","ShowResponseVo.java",1),
    //外面前端业务接口api
    HTTP_VO_REQUEST(4,"saas","/saas/saas_base_request_vo.java.vm","/vo/request/","RequestVo.java",1),
    HTTP_VO_RESPONSE(4,"saas","/saas/saas_base_response_vo.java.vm","/vo/response/","ResponseVo.java",1),


    //微服务,内部调用 api service项目 app + domain 提供外部spring cloud使用,通过代码实现对外服务
    API_SERVICE(5,"saas","/saas/saas_api.java.vm","/api/","Api.java"),
    //domain 基础公共对象配置
    API_DTO_QUERY_ENUM(6,"saas","/saas/saas_query_enum.java.vm","/dto/enums/","QueryEnum.java"),
    API_DTO_REQUEST(6,"saas","/saas/saas_base_request_dto.java.vm","/dto/request/","RequestDto.java",1),
    API_DTO_RESPONSE(6,"saas","/saas/saas_base_response_dto.java.vm","/dto/response/","ResponseDto.java",1),
    API_DTO_BEAN(6,"saas","/saas/saas_base_response_bean.java.vm","/dto/bean/","BeanDto.java",1),

    //rpc infrastructure
    RPC_MODEL(7,"saas","/saas/saas_entity.java.vm","/entity/",".java",1),
    RPC_MAPPER(7,"saas","/saas/saas_mapper.java.vm","/mapper/","Mapper.java"),
    RPC_MAPPER_XML(7,"saas","/saas/saas_mapper.xml.vm","/mapper/","Mapper.xml"),
//    RPC_CACHE_DAO(7,"saas","/saas/saas_entity_cache_dao.java.vm","/repository/","Dao.java"),
    RPC_ENTITY_DAO(7,"saas","/saas/saas_entity_dao.java.vm","/repository/","Repository.java"),
//    RPC_SERVICE_IMPL(1,"saas_service_impl.java.vm","/service/","ServiceImpl.java"),

    //与rpc infrastructure平级,依懒domain,将第三方sdk转换自定义对象DTO
    RPC_CLIENT(8,"saas","/saas/saas_sdk_client.java.vm","/client/","Client.java"),


    ;

    private int index;
    private String type;
    private String temp;
    private String path;
    private String ext;
    private int isWrite;

    SaasCodeEnum(int index,String type,String temp, String path, String extName){
        this.index = index;
        this.type = type;
        this.temp = temp;
        this.path = path;
        this.ext = extName;
    }
    SaasCodeEnum(int index,String type,String temp, String path, String extName,int isWrite){
        this.index = index;
        this.type = type;
        this.temp = temp;
        this.path = path;
        this.ext = extName;
        this.isWrite = isWrite;
    }
//    private static Map<String, saasCodeEnum> typeMap = new HashMap<>();
//    static {
//
//        for(saasCodeEnum type : values()) {
//            typeMap.put(type.getTemp(), type);
//        }
//    }
//    public static saasCodeEnum  getEnum(String tem) {
//        return typeMap.get(tem);
//    }


    @Override
    public String getType() {
        return type;
    }

    public String getTemp() {
        return temp;
    }

    public String getPath() {
        return path;
    }

    public String getExt() {
        return ext;
    }

    public int getIndex(){
        return index;
    }

    public  int isWrite(){ return isWrite;}
}
